<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <!-- 
    v-model的底层实质就是通过v-bind 和 v-on的结合
  -->
  <div id="app">
    <div>{{msg}}</div>
    <!-- <input :value="msg" @input="handld"> -->
    <!-- 可以简化成这个样子 -->
    <input :value="msg" @input="msg=$event.target.value">
  </div>
  <script src="../js/vue.js"></script>
  <script>
    const vm = new Vue({
      el: "#app",
      data: {
        msg: "太酷了吧"
      },
      methods: {
        /* handld(event) {
          // event.target.value; 获取事件对象的value的值
          this.msg = event.target.value;
        } */
      }
    });

  </script>
</body>

</html>
